﻿using Castle.ActiveRecord;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TES.Domain
{
    /// <summary>
    /// 评价详细
    /// </summary>
    [ActiveRecord("Evaluationlnfo")]
    public  class Evaluationlnfo:EntityBase
    {
        /// <summary>
        /// 评价人
        /// </summary>
        [BelongsTo(Type = typeof(User),
              Column = "ReviewersID",
              NotNull = false,
              Cascade = CascadeEnum.None,
              Lazy = FetchWhen.OnInvoke)]
        [Display(Name = "评价人")]
        public virtual User Reviewers { get; set; }

        /// <summary>
        /// 被评价人
        /// </summary>
        [BelongsTo(Type = typeof(User),
              Column = "EvaluatedID",
              NotNull = false,
              Cascade = CascadeEnum.None,
              Lazy = FetchWhen.OnInvoke)]
        [Display(Name = "被评价人")]
        public virtual User Evaluated { get; set; }

        /// <summary>
        /// 评价指标
        /// </summary>
        [BelongsTo(Type = typeof(Indicators),
              Column = "IndicatorsID",
              NotNull = false,
              Cascade = CascadeEnum.None,
              Lazy = FetchWhen.OnInvoke)]
        [Display(Name = "指标")]
        public virtual Indicators Indicators { get; set; }

        /// <summary>
        /// 评价分数{总分}
        /// </summary>
        [Property(NotNull = true, Length = 53)]
        [Required(ErrorMessage = "不能为空")]
        [StringLength(53, ErrorMessage = "不能超过53个字符")]
        [Display(Name = "总分")]
        public virtual string TotalResults { get; set; }
    }
}
